package top.ijiujiu.component;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

/**
 * MyMetaObjectHandler
 *
 * @Author 神秘的黄瓜
 * @Version 1.0
 * @Date 2020-04-01 11:46
 */
@Component
public class MyMetaObjectHandler implements MetaObjectHandler {


    @Override
    public void insertFill(MetaObject metaObject) {
        if (metaObject.hasGetter("deleteFlag")) {
            setFieldValByName("deleteFlag", "N", metaObject);
        }
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
